package org.aphelie.romancer.util.message.tests;

import java.io.File;
import java.net.URL;
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;

import junit.framework.TestCase;

import org.aphelie.romancer.util.tests.RomancerUtilTestPlugin;

public class MessageTest extends TestCase {
	
	private static final String MESSAGE_BUNDLE = "org.aphelie.romancer.util.tests.i18n.messages";
	
	public void testMessageBundle() {
		
		ResourceBundle localBundle = ResourceBundle.getBundle(MESSAGE_BUNDLE, Locale.getDefault());
		
		System.err.println("bundle " + localBundle);
		
		String prefix = getClass().getPackage().getName().replace(".", "/");
		
		System.err.println("prefix " + prefix);
		
		Enumeration<URL> messageBundleUrls = RomancerUtilTestPlugin.getInstance().getBundle().findEntries("/",
				"messages" + ".properties", true);
		while (messageBundleUrls.hasMoreElements()) {
			URL elt = messageBundleUrls.nextElement();
			System.err.println("elt " + elt);
			
		}
		
		this.getClass().getPackage().getName();
		
		
		
		
		
		assertNotNull(localBundle);
		
		URL bundleRootURL = RomancerUtilTestPlugin.getInstance().getBundle().getEntry("/");
		System.err.println("bundleRootURL " + bundleRootURL);
		
		File bundleRootDir = new File(bundleRootURL.getPath());
		System.err.println("bundleRootDir " + bundleRootDir);
		

		
		
		
		
		
	}
	
	
	

}
